package com.winit.common.base.web;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by wangjian on 16/1/16.
 *
 */
@RestController
@RequestMapping("/error")
public class ErrorController {

    @RequestMapping("/noPower")
    @ResponseBody
    public Map<String,Object> noPower(HttpServletRequest request, HttpServletResponse response){
        Map<String,Object> rtnMap = new HashMap<String, Object>();
        rtnMap.put("code","3");
        rtnMap.put("desc","当前用户没有访问权限");
        return rtnMap;
    }

    @RequestMapping("/noUser")
    @ResponseBody
    public Map<String,Object> noUser(HttpServletRequest request, HttpServletResponse response){
        Map<String,Object> rtnMap = new HashMap<String, Object>();
        rtnMap.put("code","2");
        rtnMap.put("desc","获取登录用户信息为空");
        return rtnMap;
    }


}
